<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>正则扩展</title>
</head>
<body>
<script type="text/javascript">
    {
        let regex = new RegExp('xyz', 'i');
        console.log(regex); // /xyz/i
    }
</script>
</body>
</html>